/*
 * Copyright 2007-2008 by Matthias Buch-Kromann <mbk.isv@cbs.dk>.
 * 
 * This file is part of the Open-source Dependency Toolkit (OSDT),
 * see http://code.google.com/p/open-source-dependency-toolkit. 
 * 
 * The OSDT is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License,
 * or (at your option) any later version.
 *
 * The OSDT is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with the OSDT in the file COPYING and COPYING.LESSER. If not, see
 * http://www.gnu.org/licenses.
 */


package org.osdtsystem.graphs;

/**
 * The public graph interface for all methods that are used to deal with
 * interactions between a graph and its base graph.
 * @author Matthias Buch-Kromann <mbk.isv@cbs.dk>
 */
public interface GraphDeltaInterface {
    /**
     * Is this graph equal to or a descendant of the given ancestor graph?
     * @param ancestor the ancestor graph
     * @return <code>true</code> if this graph equals or descends from the ancestor,
     * <code>false</code> otherwise
     */
    public boolean descendsFrom(Graph ancestor);
    
    /**
     * Saves the graph modifications in this graph in the directly underlying base graph,
     * and clears the modifications in this graph.
     */
    public void commitChangesToBase();
    
    /**
     * Saves the graph modifications in this graph and all intermediate base 
     * graphs in the root base graph, and clears the modifications in this graph
     * and all intermediate base graphs.
     */
    public void commitChangesToRoot();    
}
